/*
 * Slider.h
 *
 * Author: Samuel Queiroz
 */

#ifndef SLIDER_H_
#define SLIDER_H_

class Slider
{

private:

	int value;

	int upperBound;
	int lowerBound;

public:

	Slider(int upperBound)
	{
		this->lowerBound = 1;
		this->upperBound = upperBound;

		int range = upperBound - lowerBound;
		this->value = lowerBound + (range / 2) + (range % 2);
	}

	inline int getValue()
	{
		return value;
	}

	inline int getUpperBound()
	{
		return upperBound;
	}

	inline void increment()
	{
		if (this->value < upperBound)
		{
			this->value++;
		}
	}

	inline void decrement()
	{
		if (this->value > lowerBound)
		{
			this->value--;
		}
	}

};

#endif
